<template>
  <!--  操作记录 -->
  <div class="block" id="timeline">
    <el-timeline class="timeline-content">
      <div class="timeline-wk">
        <div class="timeline-item" v-for="(item, index) in data">
          <div class="timeline-title">
            <span class="timeline-type-icon">操作时间：{{ item.opt_time }}</span>
          </div>
          <div class="timeline-container">
            <div class="timeline-container-list">
              详情：对文件路径：<span>{{ item.path }}《{{ item.name }}》</span>进行<span
                class="red-font">{{ optTypeList[item.opt_type] }}</span>操作<span
                v-if="item.opt_type == 3 || item.opt_type == 4 || item.opt_type == 5">，保存到文件路径:{{ item.dst_path }}。</span><span
                v-else>。</span>
            </div>
          </div>
        </div>
      </div>


    </el-timeline>
  </div>
</template>

<script>
export default {
  name: 'timeLine',
  props: {
    data: {
      type: Array,
      default() {
        return []
      }
    },
    total: {
      type: Number,
      default() {
        return 0
      }
    }
  },
  data() {
    return {
      optTypeList: {
        '0': '未知类型',
        '1': '全盘扫描',
        '2': '查看',
        '3': '复制',
        '4': '剪切',
        '5': '重命名',
        '6': '删除',
        '20': '打印',
        '21': '刻录',
        '22': '蓝牙',
        '30': 'QQ',
        '31': '微信',
        '32': '钉钉',
        '33': '浏览器'
      }
    }
  },
  mounted() {
  },
  methods: {
    getData() {
      this.$emit('handleScroll')
    }
  }
}
</script>

<style lang="scss" scoped>
#timeline {
  max-height: 400px;
  overflow-y: auto;
}
.red-font {
  color: #FF3535
}

.timeline-count {
  background: #F3F5FC;
  padding: 10px 20px;
  border-bottom: 1px solid #E5E5E5;
}

.timeline-content {
  .timeline-wk {
    .timeline-item {
      .timeline-title {
        display: flex;
        align-items: center;
        padding: 14px 0;

        span {
          margin-left: 20px;

          &.timeline-type-icon {
            display: flex;
            align-items: center;

            /*&::before {
              display: block;
              content: '';
              width: 5px;
              height: 5px;
              margin-right: 10px;
              border-radius: 50%;
              background: #d8d8d8;
            }*/
          }
        }

        &::before {
          display: block;
          content: '';
          width: 14px;
          height: 14px;
          border-radius: 50%;
          background: #4b6eef;
          border: 2px solid #dbe2fc;
        }
      }

      .timeline-container {
        border-left: 3px solid #4B6EEF;
        padding: 20px;
        margin-left: 6px;
        display: flex;

        .timeline-container-list {
          width: 100%;

          span {
            line-height: 24px;
          }
        }
      }

    }
  }
}

::v-deep .el-timeline-item__timestamp {
  color: #303133;
  font-size: 14px;
}
</style>
